package com.atguigu.demo02;

/**
 * @author gjl
 * @create 2021-04-24 9:23
 */
public class ProdConsumerDemo {
    public static void main(String[] args) {
        Demo d = new Demo();
        new Thread(() -> {
            for (int i = 0; i < 10; i++) {
                try {
                    d.increment();
                } catch (InterruptedException e) {
                    e.printStackTrace();
                }
            }
        }, "A").start();

        new Thread(() -> {
            for (int i = 0; i < 10; i++) {
                try {
                    d.de();
                } catch (InterruptedException e) {
                    e.printStackTrace();
                }
            }
        }, "B").start();

    }
}
